package com.lysj.bhp.manager.repository;



import com.lysj.bhp.manager.domain.Privilege;
import com.lysj.bhp.util.web.SelectItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PrivilegeRepository extends JpaRepository<Privilege, Long>, JpaSpecificationExecutor {

    @Query("select  new com.lysj.bhp.util.web.SelectItem(t.privilegeId AS value,t.name AS name) from Privilege t where  t.parentId is null  ")
    List<SelectItem> selectItems();
}
